/*
 *	Copyright © 2013 Changsha Shishuo Network Technology Co., Ltd. All rights reserved.
 *	长沙市师说网络科技有限公司 版权所有
 *	http://www.shishuo.com
 */

package com.hlingsoft.cms.dao;

import com.hlingsoft.cms.entity.Goods;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.*;



@Repository
public interface GoodsDao {



	/**
	 * 添加商品
	 * 
	 * @return Integer
	 */
	public long addGoods(Goods goods);


	/**
	 * 查询最新发布商品
	 * @return
	 */
	public List<Goods> getGoodsListByCategoryId(@Param("categoryId")long categoryId);


	/**
	 * 根据id查询商品
	 * @param goodsId
	 * @return
	 */
	public  Goods getGoodsById(@Param("goodsId") long goodsId);


	/**
	 * 商品列表
	 * @return
	 */
	public List<Goods> getGoodsList();

	/**
	 * 获取商品数量
	 * @return
	 */
	public int getGoodsListCount();

	/**
	 * 删除商品
	 * @param id
	 * @return
	 */
	public int deleteGoodsById(@Param("id")long id);

	/**
	 * 更新商品
	 * @param goods
	 * @return
	 */
	public int updateGoods(Goods goods);



	public List<Goods> getGoodsWhenSearch(@Param("goodsName") String goodsName);


	/**
	 * 查找品牌蛋糕
	 * @param brandId
	 * @return
	 */
	public List<Goods> getGoodsByBrandId(@Param("brandId") long brandId);
}
